<?php
	date_default_timezone_set('Asia/Shanghai');
	define('IN_TG',true);	
	require 'commom.inc.php';

	//房子数据
	$sql = "SELECT id,title,content,contact,mobile,send_time 
			FROM nz_info
			WHERE info_type = 1 
			ORDER BY send_time DESC
	";
	$res = mysql_query($sql);
	//捕获异常
	if(!$res){
		echo '执行错误：'.mysql_error();
	}


	$houseData = array();
	while ($arr = mysql_fetch_array($res,MYSQL_ASSOC)) {
		array_push($houseData,$arr);
	}
	//工作数据


	//房子数据
	$sql = "SELECT id,title,content,contact,mobile,send_time 
			FROM nz_info
			WHERE info_type = 2 
			ORDER BY send_time DESC
	";
	$res = mysql_query($sql);
	$jobData = array();
	while ($arr = mysql_fetch_array($res,MYSQL_ASSOC)) {
		array_push($jobData,$arr);
	}
	//工作数据


?>
<!doctype html>
<html>
 
	<head>
		<!-- 页面字符编码 -->
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<title></title>

		<link href="css/mui.min.css" rel="stylesheet" />
		<link href="css/comm.css" rel="stylesheet" />
		<link href="css/iconfont.css" rel="stylesheet" />
		<link href="css/layout.css" rel="stylesheet" />
		<link href="css/layout2.css" rel="stylesheet" />
<style type="text/css">
	.mui-my-orders .mui-mess-ul li{
		width: 50%;
	}
</style>
	</head>

	<body>
		<!-- 头部 S-->

		<!-- 头部 E -->
		<div class="mui-content">
			<div class="mui-scroll-wrapper mscrollSet mui-scroll-top">
				<div class="mui-scroll">
					<div class="mui-my-order mui-my-orders">
						<!--导航栏S-->
						<ul class="mui-mess-ul">
							<li class="current">
								<a href="javascript:;">找房子</a>
							</li>
							<li>
								<a href="javascript:;">找工作</a>
							</li>
						</ul>
						<!--导航栏E-->
						<!--全部订单-->
						<div class="mui-orders-list" style="display: block;">

							<?php foreach ($houseData as $key => $value) {
								# code...
							?>
							<!--待验证订单 S-->
							<div class="mui-yz-order mt12">
								<div class="mui-yzorder-title">
									<dl>
										<dt><i><?php echo $value['title']; ?></i></dt>
										<dd >　</dd>
									</dl>
								</div>
								<div class="mui-yzorder-list">
									<div class="mui-media-body">
										<h2><?php echo $value['content']; ?></h2>
										<p>联系人：<i><?php echo $value['contact']; ?></i></p>
										<span>
											<i>联系方式：</i><?php echo $value['mobile']; ?>
										</span>
									</div>
								</div>
								<dl class="mui-order-time">
									<dt>发送时间</dt>
									<dd><?php echo date('m月d日'); ?></dd>
								</dl>
								<div class="mui-yzorder-btn"> </div>
							</div>
							<!--待验证订单 E-->
							<?php }?>

							<!--鲜篮子logo-->
							<div class="mui-logo" style="border-bottom:1px dashed #ccc;">
								<p>我是有底线的</p>
							</div>
							<!--鲜篮子logo-->
						</div>

						<!--待验证订单-->
						<div class="mui-orders-list">
							<?php foreach ($jobData as $key => $value) {
									# code...
								?>
								<!--待验证订单 S-->
								<div class="mui-yz-order mt12">
									<div class="mui-yzorder-title">
										<dl>
											<dt><i><?php echo $value['title']; ?></i></dt>
											<dd >　</dd>
										</dl>
									</div>
									<div class="mui-yzorder-list">
										<div class="mui-media-body">
											<h2><?php echo $value['content']; ?></h2>
											<p>联系人：<i><?php echo $value['contact']; ?></i></p>
											<span>
												<i>联系方式：</i><?php echo $value['mobile']; ?>
											</span>
										</div>
									</div>
									<dl class="mui-order-time">
										<dt>发送时间</dt>
										<dd><?php echo date('m月d日'); ?></dd>
									</dl>
									<div class="mui-yzorder-btn"> </div>
								</div>
								<!--待验证订单 E-->
								<?php }?>

							<!--鲜篮子logo-->
							<div class="mui-logo" style="border-bottom:1px dashed #ccc;">
								<p>我是有底线的</p>
							</div>
							<!--鲜篮子logo-->
						</div>
						<!--待验证订单-->

					</div>
				</div>
			</div>
		</div>
		<script src="js/mui.min.js"></script>
		<script type="text/javascript" src="js/jquery-2.1.0.js"></script>
		<script src="js/scroll-wrapper.js"></script>
		<script type="text/javascript">
			$(function() {
				window.onload = function() {
					var $li = $('.mui-mess-ul li');
					var $ul = $('.mui-orders-list');
					$li.click(function() {
						var $this = $(this);
						var $t = $this.index();
						$li.removeClass();
						$this.addClass('current');
						$ul.css('display', 'none');
						$ul.eq($t).css('display', 'block');
					})
				}
			});
		</script>
	</body>

</html>